home *** CD-ROM | disk | FTP | other *** search
- /* VMPF/CCC
- * virtual memory utility functions
- *
- * Copyright 1983, 1984 by Jim Kyle - All Rights Reserved
- * Licensed for individual non-commercial use only.
- *
- * created: November 16, 1983 - Jim Kyle
- * last changed: February 12, 1984 - Jim Kyle per
- * Dick Yavich suggestion
- */
-
- /*
- * smudge() makes the current slot dirty so that it
- * will be written out on a swap. It should be called
- * after every modification of the slot's contents.
- * Otherwise, the modification may not be saved if the
- * slot is swapped to some other block.
- */
- smudge() /* make current slot dirty */
- { *Bcptr |= DIRTY; }
-
- /*
- * cur_size() returns the byte count of the current
- * block, stripping out the "dirty bit"
- */
- cur_size() /* return current byte count */
- { return(*Bcptr & CLEAN); }
-
- /*
- * getwd() returns an int value from a char pointer;
- * it substitutes for a cast.
- */
- getwd(p) int *p;
- { return(*p); }
-
- /*
- * putwd() stores an int value at *p/*++p; it takes
- * the place of a cast.
- */
- putwd(n,p) int n, *p;
- { *p = n; }
-
- char * eob() /* return char ptr to freespace */
- { return(Dbptr - BHAD + cur_size()); }
-
- char * clad() /* char ptr to current line */
- { return(Dbptr + Dbndx); }
-
- set_ndx(p) char *p; /* int index to *p */
- { return(p - Dbptr); }
-
- char * llad() /* char ptr to last line in block */
- { int i;
- char *j;
- j = Dbptr;
- i = *Lcptr;
- while (--i)
- j += getwd(j);
- return(j);
- }
-
-